package com.hefei.api.customer.client;

import org.apache.log4j.Logger;

import com.hefei.common.http.client.ServiceUrlConstants;
import com.hefei.common.util.ConfigReader;

public class CustomerUrlConstants extends ServiceUrlConstants{

	private static final Logger log = Logger.getLogger(CustomerUrlConstants.class);
	public static final String CONFIG_FILE_NAME_CONF = "customer-server-url-conf";
	/**系统登录地址**/
	public static String CUSTOMER_SERVER_LOGIN_URL = null;
	/*
	 * (对customer的增 删 改 查)
	 * @see com.hefei.common.http.client.ServiceUrlConstants#init(java.lang.String)
	 */
	public static String CUSTOMER_SERVER_ADD_CUSTOMER_URL = null;
	public static String CUSTOMER_SERVER_EDIT_CUSTOMER_URL = null;
	public static String CUSTOMER_SERVER_DELETE_CUSTOMER_URL = null;
	public static String CUSTOMER_SERVER_GET_CUSTOMER_BY_ID = null;
	public static String CUSTOMER_SERVER_GET_CUSTOMER_BY_NAME = null;
	public static String CUSTOMER_SERVER_GET_DATAGRID_TOTAL = null;
	/**
	 * menu
	 */
	public static String SYSMENU_GET_DATAGRID_TOTAL = null;
	public static String SYSMENU_DATA_GRID_MENU = null;
	public static String SYSMENU_GET_ALL_MENU = null;
	public static String SYSMENU_DELETE_BY_ID_MENU = null;
	public static String SYSMENU_GET_MENU_BY_ID = null;
	public static String SYSMENU_LIST_ALL_PARENT_MENU = null;
	public static String SYSMENU_SAVE_MENU = null;
	public static String SYSMENU_LIST_SUB_MENU_BY_PARENTID= null;
	public static String SYSMENU_LIST_ALL_MENU= null;
	public static String SYSMENU_LIST_ALL_SUB_MENU= null;
	public static String SYSMENU_INSERT_MENU= null;
	public static String SYSMENU_UPDATE_MENU= null;
	/**
	 * systemdef
	 */
	public static String SYSDEF_GET_ALL = null;
	public static String SYSDEF_GET_BY_ID = null;
	public static String SYSDEF_INSERT = null;
	public static String SYSDEF_UPDATE = null;
	public static String SYSDEF_DELETE_BY_ID = null;
	
	public void init(String configFileName) {
		try{
			ConfigReader reader = ConfigReader.read(configFileName);
			CUSTOMER_SERVER_LOGIN_URL = reader.getConstant("CUSTOMER_SERVER_LOGIN_URL");
			CUSTOMER_SERVER_ADD_CUSTOMER_URL = reader.getConstant("CUSTOMER_SERVER_ADD_CUSTOMER_URL");
			CUSTOMER_SERVER_EDIT_CUSTOMER_URL = reader.getConstant("CUSTOMER_SERVER_EDIT_CUSTOMER_URL");
			CUSTOMER_SERVER_DELETE_CUSTOMER_URL = reader.getConstant("CUSTOMER_SERVER_DELETE_CUSTOMER_URL");
			CUSTOMER_SERVER_GET_CUSTOMER_BY_ID = reader.getConstant("CUSTOMER_SERVER_GET_CUSTOMER_BY_ID");
			CUSTOMER_SERVER_GET_CUSTOMER_BY_NAME = reader.getConstant("CUSTOMER_SERVER_GET_CUSTOMER_BY_NAME");
			CUSTOMER_SERVER_GET_DATAGRID_TOTAL = reader.getConstant("CUSTOMER_SERVER_GET_DATAGRID_TOTAL");
			
			SYSMENU_GET_DATAGRID_TOTAL = reader.getConstant("SYSMENU_GET_DATAGRID_TOTAL");
			SYSMENU_DATA_GRID_MENU = reader.getConstant("SYSMENU_DATA_GRID_MENU");
			SYSMENU_GET_ALL_MENU = reader.getConstant("SYSMENU_GET_ALL_MENU");
			SYSMENU_DELETE_BY_ID_MENU = reader.getConstant("SYSMENU_DELETE_BY_ID_MENU");
			SYSMENU_GET_MENU_BY_ID = reader.getConstant("SYSMENU_GET_MENU_BY_ID");
			SYSMENU_LIST_ALL_PARENT_MENU = reader.getConstant("SYSMENU_LIST_ALL_PARENT_MENU");
			SYSMENU_SAVE_MENU = reader.getConstant("SYSMENU_SAVE_MENU");
			SYSMENU_LIST_SUB_MENU_BY_PARENTID = reader.getConstant("SYSMENU_LIST_SUB_MENU_BY_PARENTID");
			SYSMENU_LIST_ALL_MENU = reader.getConstant("SYSMENU_LIST_ALL_MENU");
			SYSMENU_LIST_ALL_SUB_MENU = reader.getConstant("SYSMENU_LIST_ALL_SUB_MENU");
			SYSMENU_INSERT_MENU = reader.getConstant("SYSMENU_INSERT_MENU");
			SYSMENU_UPDATE_MENU = reader.getConstant("SYSMENU_UPDATE_MENU");
			
			SYSDEF_GET_ALL = reader.getConstant("SYSDEF_GET_ALL");
			SYSDEF_GET_BY_ID = reader.getConstant("SYSDEF_GET_BY_ID");
			SYSDEF_INSERT = reader.getConstant("SYSDEF_INSERT");
			SYSDEF_UPDATE = reader.getConstant("SYSDEF_UPDATE");
			SYSDEF_DELETE_BY_ID = reader.getConstant("SYSDEF_DELETE_BY_ID");
		}catch(Exception e){
			log.error("UrlConstants init exception", e);
			System.exit(0);
		}
		
	}
}
